<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>增加用户</title>
    <script src="<%=request.getContextPath()%>/static/js/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
    <!--
       如果要进行文件上传，对于表单有两个要求
       1）必须要封装表单为多步请求:enctype="multipart/form-data"
       2) 请求的方式必须是post请求
    -->
    <form action="<%=request.getContextPath()%>/user/addUser" method="post" enctype="multipart/form-data">
        <table>
            <tr>
                <td>手机:</td>
                <td><input type="text" name="telephone"></td>
            </tr>
            <tr>
                <td>密码:</td>
                <td><input type="password" name="password"></td>
            </tr>
            <tr>
                <td>姓名:</td>
                <td><input type="text" name="realname"></td>
            </tr>
            <tr>
                <td>生日:</td>
                <td><input type="text" name="birthday" onClick="WdatePicker()" class="Wdate"></td>
            </tr>
            <tr>
                <td>图像:</td>
                <td><input type="file" name="headImage"></td>
            </tr>
            <tr>
                <td>所属部门:</td>
                <td>
                    <select name="dept.id">
                        <c:forEach var="dept" items="${deptList}">
                            <option value="${dept.id}">${dept.dname}</option>
                        </c:forEach>
                    </select>
                </td>
            </tr>
            <tr>
                <td>角色:</td>
                <td>
                    <c:forEach var="role" items="${roleList}" varStatus="vs">
                        <input type="checkbox" name="roleIds" value="${role.id}">${role.rolename}
                    </c:forEach>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="submit" value="提交">
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
